//
//  UIButton+Extension.swift
//  LXQWB
//
//  Created by 江海天 on 2017/7/3.
//  Copyright © 2017年 江海天. All rights reserved.
//

import UIKit

extension UIButton{
	
	convenience init(imageName: String,imageBackgroundName: String?) {
		self.init()
		setImage(UIImage(named: imageName), for: UIControlState.normal)
		setImage(UIImage(named: imageName + "_highlighted"), for: UIControlState.normal)
		if let backIamge = imageBackgroundName {
			setBackgroundImage(UIImage(named: backIamge), for: UIControlState.normal)
			setBackgroundImage(UIImage(named: backIamge + "_highlighted"), for: UIControlState.highlighted)
			
		}
		sizeToFit()
		
		

	}
}
